package com.beamfield.dao.device;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.beamfield.model.DeviceDemanDetail;

public interface DeviceDemanDetailMapper {
    int deleteByPrimaryKey(Long id);

    int insert(DeviceDemanDetail record);

    int insertSelective(DeviceDemanDetail record);

    DeviceDemanDetail selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(DeviceDemanDetail record);

    int updateByPrimaryKey(DeviceDemanDetail record);

    List<DeviceDemanDetail> selectDetailsByDemandId(@Param("demandId") String demandId,
                                                    @Param("suppliesName") String suppliesName,
                                                    @Param("projectId") String projectId,
                                                    @Param("offset") String offset,
                                                    @Param("limit") String limit);
    long countDetailsByDemandId(@Param("demandId") String demandId,
                                                    @Param("suppliesName") String suppliesName,
                                                    @Param("projectId") String projectId
                                                   );

    List<DeviceDemanDetail> readCanPurchase(@Param("demandId")String demandId);

    List<DeviceDemanDetail> selectByIdAndDevice(@Param("demandId") Long demandId, @Param("deviceId") Long deviceId);

    int selectDemandNums(@Param("beam_id")long beam_id,@Param("type")int type);

	int deleteByDeviceDemandId(@Param("demandId")Long id);

}